#ifndef ACCOUNT_H
#define ACCOUNT_H

#include <iostream>
#include <fstream>
#include <sstream>
#include "Expense.h"
#include "Income.h"
#include "Wish.h"
#include "Loan.h"
#include <list>
#include <time.h>// four time-related types: clock_t, time_t, size_t, and tm
//#include <fstream> //read and write database file
//#include "json.h" //include JSON

using namespace std;

//@author U095387X
class Account{

//Attributes
private:
	list<Expense> _ExpenseList;
	list<Income> _IncomeList;
	list<Wish> _WishList;
	list<Loan> _LoanList;

//Methods
public:
	Account();

	void saveAccount();

	void obtainExpense();
	void obtainIncome();
	void obtainLoan();
	void obtainWish();

	void writeToExpense();
	void writeToIncome();
	void writeToLoan();
	void writeToWish();

	list<Expense> readExpense(time_t startTime, time_t endTime);
	list<Income> readIncome(time_t startTime, time_t endTime);
	list<Wish> readWish(time_t startTime, time_t endTime);
	list<Wish> readWish();
	list<Loan> readLoan(time_t startTime, time_t endTime);
	list<Loan> readLoan();

	void addExpense(Expense& newExpense);
	void addIncome(Income newIncome);
	void addWish(Wish newWish);
	void addLoan(Loan newLoan);

	void deleteExpense(Expense dExpense);
	void deleteIncome(Income dIncome);
	void deleteWish(Wish dWish);
	void deleteLoan(Loan dLoan);

	list<Expense> findCategory( e_category num, int startTime, int EndTime);

};

#endif